home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / patches / ip20t21a.lha / IFX20to21a_Patch / Install_Extras_2.1a < prev    next >
Text File  |  1995-11-10  |  11KB  |  370 lines

  1. ; ImageFX 2.1a Extras Patch Install Script
  2. ;
  3. ; Written by Thomas Krehbiel
  4. ;
  5. ; Copyright © 1995 Nova Design, Inc.
  6. ; All Rights Reserved
  7.  
  8. (
  9.  
  10.    ;================================================================
  11.    ; Procedure Definitions
  12.    ;================================================================
  13.  
  14.    (procedure RunLhex
  15.       ; pf_archive = name of archive to extract from
  16.       ; pf_name = name of file to extract
  17.       ; tempdir = directory to extract to
  18.       (
  19.          (set pf_error
  20.             (run
  21.                ("RAM:lhex -a -f \"-w=%s\" x %s %s"
  22.                   tempdir
  23.                   pf_archive
  24.                   pf_name
  25.                )
  26.             )
  27.          )
  28.       )
  29.    )
  30.  
  31.    (procedure RunPatch
  32.       ; pf_old = old version of file
  33.       ; pf_new = where to put new version of file
  34.       ; pf_patch = name of patch file
  35.       (
  36.          (set pf_error
  37.             (run
  38.                ("RAM:spatch \"-o%s\" \"-p%s\" \"%s\""
  39.                   pf_new
  40.                   pf_patch
  41.                   pf_old
  42.                )
  43.             )
  44.          )
  45.       )
  46.    )
  47.  
  48.    (procedure DoPatch
  49.       ; pf_name = name of file with path
  50.       ; wheredir = where old files reside
  51.       ; patchdir = where patches reside
  52.       (
  53.          (set pf_user (tackon wheredir pf_name))
  54.          (set pf_old (tackon tempdir pf_name))
  55.          (set pf_new ("%s.new" (tackon wheredir pf_name)))
  56.          (set pf_patch ("%s.pch" (tackon patchdir pf_name)))
  57.          (if (exists pf_user)
  58.             (
  59.                ; only if it was installed
  60.                (working "Reading " pf_archive)
  61.                (RunLhex)
  62.                (if pf_error
  63.                   (
  64.                      (message "LHEX failed on `" pf_archive "'.")
  65.                   )
  66.                )
  67.                (working "Updating " pf_name)
  68.                (RunPatch)
  69.                (if pf_error
  70.                   (
  71.                      (message "Patch failed on file `" pf_user "'.")
  72.                   )
  73.                   ; else
  74.                   (
  75.                      (delete pf_user)
  76.                      (rename pf_new pf_user)
  77.                   )
  78.                )
  79.                (delete pf_old)
  80.             )
  81.          )
  82.       )
  83.    )
  84.  
  85.    ;================================================================
  86.    ; Setup
  87.    ;================================================================
  88.  
  89.    ; script variables...
  90.  
  91.    (set versionname "2.1a")                     ; version number
  92.    (set programname ("ImageFX Extras %s" versionname)) ; name of program
  93.    (set diskname1 "ImageFX_Disk1:")             ; install disk name
  94.    (set diskname2 "ImageFX_Disk2:")             ; second install disk name
  95.    (set diskname3 "ImageFX_Disk3:")             ; third install disk name
  96.    (set diskname4 "ImageFX_Disk4:")             ; fourth install disk name
  97.    (set pdiskname1 "")                          ; patch install disk name
  98.    (set pdiskname2 "")                          ; patch install disk 2 name
  99.  
  100.    (set tempdir "T:")
  101.  
  102.    ; system information...
  103.  
  104.    (set osver (/ (getversion) 65536))        ; os version
  105.    (set cputype (database "cpu"))            ; cpu type
  106.  
  107.    ;-------------------
  108.    ; Pick a default directory for the installation...
  109.    (set initialdir @default-dest)            ; defaults to biggest drive
  110.    (if (getassign "ImageFX")
  111.       (
  112.          (set initialdir (getassign "ImageFX"))
  113.       )
  114.       ; else
  115.       (
  116.          (if (getassign "ImageFX2")
  117.             (
  118.                (set initialdir (getassign "ImageFX2"))
  119.                ; if we found ImageFX2:, assume user wants to keep ImageFX2:
  120.                (set assignname "ImageFX2")
  121.             )
  122.          )
  123.       )
  124.    )
  125.  
  126.    ;-------------------
  127.    ; Warn user.
  128.    (message "These 'extras' were either not created by Nova Design, Inc., "
  129.             "or are based on software not created or supported by Nova Design.  "
  130.             "Because of this, Nova Design cannot provide technical support for these extras.  "
  131.             "They are provided for your amusement only; use them at your own risk.  "
  132.             "If you do not want to install them, click `Abort Install' now.")
  133.  
  134.  
  135.    (set tryagain 1)
  136.    (while tryagain
  137.       (
  138.  
  139.          (set tryagain 0)
  140.  
  141.          ;-------------------
  142.          ; Ask where to install it...
  143.          ;(set wheredir initialdir)
  144.          (set wheredir
  145.             (askdir
  146.                (prompt "Select the directory where ImageFX is currently installed.  The extras in "
  147.                        "this directory will be updated to version " versionname ".  All of your "
  148.                        "preferences will be preserved.  NOTE:  You will need your original ImageFX 2.0 "
  149.                        "disks to apply this update.")
  150.                (help @askdir-help)
  151.                (default initialdir)
  152.             )
  153.          )
  154.  
  155.          ;-------------------
  156.          ; Make sure it's a valid ImageFX
  157.          (set checkvar 0)
  158.          (set checkvar (+ checkvar (exists (tackon wheredir "Modules/Sys/Scale"))))
  159.          (set checkvar (+ checkvar (exists (tackon wheredir "Hooks/Sys/PaintFX"))))
  160.          (if (= 0 checkvar)
  161.             (
  162.                (message "`" wheredir "' does not appear to contain a copy of ImageFX 2.0.")
  163.                (set tryagain 1)
  164.                (set initialdir wheredir)
  165.             )
  166.          )
  167.  
  168.       )
  169.    )
  170.  
  171.    (message "The " programname " update will be installed in the drawer `" wheredir "'.  If this is correct, click `Proceed'.")
  172.  
  173.    (set @default-dest wheredir)
  174.  
  175.    ;-------------------
  176.    ; Ask which versions of modules the user wants to install.
  177.    ;(set cpu
  178.    ;   (askchoice
  179.    ;      (prompt "Select which versions of hooks and modules you would "
  180.    ;              "like to install:")
  181.    ;      (help "Some ImageFX hooks and modules (such as the JPEG modules) "
  182.    ;            "have alternate versions optimized for faster processors. "
  183.    ;            "You may choose to install only the modules optimized for "
  184.    ;            "the processor in your machine to save hard drive space.")
  185.    ;      (choices
  186.    ;         "For Any Processor"
  187.    ;         "For 68000 Or 68010"
  188.    ;         "For 68020 Or 68030, No Floating Point"
  189.    ;         "For 68020 Or 68030, With Floating Point"
  190.    ;         "For 68040, With Floating Point"
  191.    ;      )
  192.    ;      (default 0)
  193.    ;   )
  194.    ;)
  195.  
  196.    ;-------------------
  197.    ; Ask which components to install
  198.    (set todo
  199.       (askoptions
  200.          (prompt "Select the " versionname " Extras you would like to install "
  201.                  "(Extras that are installed from previous versions of ImageFX "
  202.                  "will be updated automatically):")
  203.          (help "Check the boxes to indicate which extras you would like "
  204.                "installed on your system.")
  205.          (choices
  206.             "CyberGraphics Render Module"
  207.             "JSTREAM Loader & Saver Modules"
  208.          )
  209.       )
  210.    )
  211.  
  212.    (set mask_cyber   1)
  213.    (set mask_jstream 2)
  214.  
  215.    ;================================================================
  216.    ; PATCH EXISTING FILES
  217.    ;================================================================
  218.  
  219.    ;-------------------
  220.    ; Copy SPATCH to RAM: for speediness
  221.    (copyfiles
  222.       (prompt "")
  223.       (help "")
  224.       (source pdiskname1)
  225.       (dest "RAM:")
  226.       (choices "spatch")
  227.    )
  228.  
  229.    ;================================================================
  230.    ; DISK 1
  231.    ;================================================================
  232.  
  233.    (askdisk
  234.       (prompt "Please insert ImageFX 2.0 Disk 1 in any drive.")
  235.       (help "")
  236.       (dest (substr diskname1 0 (- (strlen diskname1) 1)))
  237.       (assigns)
  238.    )
  239.  
  240.    ;-------------------
  241.    ; Copy LHEX to RAM: for speediness
  242.    (copyfiles
  243.       (prompt "")
  244.       (help "")
  245.       (source diskname1)
  246.       (dest "RAM:")
  247.       (choices "lhex")
  248.    )
  249.  
  250.    ;-------------------
  251.    ; Begin by extracting our patch archive into the user's
  252.    ; chosen ImageFX directory.  This will be deleted at the end.
  253.  
  254.    (working "Extracting Update Files...")
  255.  
  256.    (set patchdir (tackon wheredir "PatchesX"))
  257.    (makedir patchdir)
  258.  
  259.    (if (= 0 (exists (tackon pdiskname1 "PatchesX.lha")))
  260.       (
  261.          (set pdiskname2 "IFX_20to21a_Disk2:")  ; patch install disk 2 name
  262.          (askdisk
  263.             (prompt "Please insert ImageFX Patch Disk 2 in any drive.")
  264.             (help "")
  265.             (dest (substr pdiskname2 0 (- (strlen pdiskname2) 1)))
  266.             (assigns)
  267.          )
  268.       )
  269.    )
  270.  
  271.    (run
  272.       ("RAM:lhex >CON:0/0//80/lhex/AUTO -a -f \"-w=%s\" x %s"
  273.          patchdir
  274.          (tackon pdiskname2 "PatchesX.lha")
  275.       )
  276.    )
  277.  
  278.    ;================================================================
  279.    ; DISK 4
  280.    ;================================================================
  281.  
  282.    ; only patch postscript if it's there already
  283.    (if (exists (tackon wheredir "Modules/Loaders/PostScript"))
  284.       (
  285.  
  286.          (askdisk
  287.             (prompt "Please insert ImageFX 2.0 Disk 4 in any drive.")
  288.             (help "")
  289.             (dest (substr diskname4 0 (- (strlen diskname4) 1)))
  290.             (assigns)
  291.          )
  292.  
  293.          ; copy hooks.lha to ram for speed
  294.          (copyfiles
  295.             (prompt "")
  296.             (help "")
  297.             (source diskname4)
  298.             (dest tempdir)
  299.             (choices "Extras1.lha")
  300.          )
  301.  
  302.          (set pf_archive (tackon tempdir "Extras1.lha"))
  303.  
  304.          (set pf_name "Modules/Loaders/PostScript") (DoPatch)
  305.  
  306.          (delete (tackon tempdir "Extras1.lha"))
  307.          (run ("delete %s all quiet" (tackon tempdir "Modules")))
  308.  
  309.       )
  310.    )
  311.  
  312.    ;================================================================
  313.    ; INSTALL NEW FILES
  314.    ;================================================================
  315.  
  316.    ; don't need these any more
  317.    (delete "RAM:spatch")
  318.    (delete "RAM:lhex")
  319.  
  320.    (if (BITAND mask_cyber todo)
  321.       (
  322.          (copyfiles
  323.             (prompt "")
  324.             (help "")
  325.             (source (tackon patchdir "Modules/Render"))
  326.             (dest (tackon wheredir "Modules/Render"))
  327.             (choices "CyberGraphics.000" "CyberGraphics.030")
  328.          )
  329.       )
  330.    )
  331.  
  332.    (if (BITAND mask_jstream todo)
  333.       (
  334.          (copyfiles
  335.             (prompt "")
  336.             (help "")
  337.             (source (tackon patchdir "Modules/Loaders"))
  338.             (dest (tackon wheredir "Modules/Loaders"))
  339.             (choices "JSTREAM.000" "JSTREAM.030" "JSTREAM.040")
  340.          )
  341.          (copyfiles
  342.             (prompt "")
  343.             (help "")
  344.             (source (tackon patchdir "Modules/Savers"))
  345.             (dest (tackon wheredir "Modules/Savers"))
  346.             (choices "JSTREAM.000" "JSTREAM.030" "JSTREAM.040")
  347.          )
  348.          (copyfiles
  349.             (prompt "")
  350.             (help "")
  351.             (source (tackon patchdir "Help"))
  352.             (dest (tackon wheredir "Help"))
  353.             (choices "JStream.guide" "JStream.guide.info")
  354.          )
  355.       )
  356.    )
  357.  
  358.    ; delete the patches
  359.    (run ("delete %s all quiet" patchdir))
  360.  
  361.    ; Installation complete!
  362. )
  363.  
  364. ; Revision History:
  365. ;
  366. ;  14.04.95 tek   Created for Beta 2 release.
  367. ;  07.11.95 tek   Updated for 2.0 -> 2.1a patch operation.
  368.  
  369.  
  370.